Method and apparatus for acquiring time spent on system shutdown

ABSTRACT

A method for determining time spent on system shutdown is provided. The method may involve identifying a time at which a shutdown instruction is initiated during the system shutdown. Further, an exit time of an object that is the last to exit during the system shutdown may be identified. The time spent on the system shutdown may be determined based on the time at which the shutdown instruction is initiated and the exit time of the object that is the last to exit. The method for determining time spent on system shutdown may obtain the system time spent on the previous system shutdown regardless of the reason that the system was shut down. Further, the user may be instructed to optimize the system according to the time spent on system shutdown.

This application claims priority to and is a continuation ofPCT/CN2014/070006, filed on Jan. 2, 2014 and entitled “METHOD ANDAPPARATUS FOR ACQUIRING TIME SPENT ON SYSTEM SHUTDOWN”, which claimspriority to Chinese Patent Application No. 201310083992.4, entitled“METHOD AND APPARATUS FOR ACQUIRING TIME SPENT ON SYSTEM SHUTDOWN”,filed with State Intellectual Property Office of PRC on Mar. 15, 2013,which are incorporated herein by reference in their entireties.

TECHNICAL FIELD

The present disclosure relates to the field of testing technology, andin particular to a method and an apparatus for determining time spent onsystem shutdown.

BACKGROUND

Once a system, such as a computer, is started up, generally a prompt mayprovide information such as time spent on booting the system. However,in addition, or alternatively, time spent on system shutdown may be animportant factor to determine.

Typically, rebooting the system includes time for system booting andtime for system shutdown. The time spent on system shutdown may becalculated by determining the time for a system reboot and the timespent on a system boot (or system startup).

However, this technique may only help to determine the time spent onsystem shutdown in case a system reboot is performed, and not in anormal shutdown or any other shutdown that is not initiated by a systemreboot.

SUMMARY

The embodiments of the present disclosure provide a method fordetermining time spent on a system shutdown. The method may enabledetermining the time spent on the system shutdown during the systemreboot, regardless of the reason that the system is shut down before.The user may be able to optimize the system according to the time spenton system shutdown. The embodiments of the present disclosure alsoprovide an apparatus to determine the duration of a system shutdown.

According to an embodiment of the present disclosure, a method foracquiring time spent on a previous system shutdown may include at leastthe following steps. Initially, a time, or an instant of time, at whicha shutdown instruction that may have caused the system shutdown wasinitiated, is identified. Further, an exit time of an object that wasthe last to exit during the system shutdown is identified. The timespent on the system shutdown may then be determined according to thetime at which the shutdown instruction was initiated and the exit timeof the object that was the last to exit.

Identifying the time at which the shutdown instruction was initiatedduring the system shutdown may include identifying an occurring time, oroccurrence time of a system event that is representative of the systemshutdown. Such a system shutdown may be identified as the system eventthat has the earliest occurring time, according to a system log, duringthe system shutdown. The exit time of the object that is the last toexit during the system shutdown may include determining occurring timeof a system event that has a latest occurring time, according to thesystem log, during the system shutdown. Determining the time spent onthe system shutdown may then be done according to the occurring time ofthe system event that has the earliest occurring time and the occurringtime of the system event that has the latest occurring time in thesystem log.

In another example, identifying the time at which a shutdown instructionwas may include determining a time at which an object that is the firstto receive the shutdown instruction received the shutdown instructionduring the system shutdown. An exit time of an object that is the lastto exit during the system shutdown may be determined as an exit time ofan object that was the last to receive the shutdown instruction duringthe system shutdown. The time spent on the system shutdown may bedetermined according to the time at which the object that was the firstto receive the shutdown instruction received the shutdown instructionand the exit time of the object that was the last to receive theshutdown instruction.

Determining a time at which a shutdown instruction was initiated duringthe system shutdown may include at least the following steps. An objectthat is preset to receive the shutdown instruction the earliest during asystem shutdown may be identified. The time at which the preset objectreceived the shutdown instruction may be used as the time at which theshutdown instruction was initiated. Further, an object that is preset toreceive the shutdown instruction the last during a system shutdown maybe identified and the time such a preset object received the systemshutdown instruction may be used as the exit time of the object that wasthe last to receive the shutdown instruction. Next, the time spent onthe system shutdown may be calculated according to the time at which theobject that is preset to receive the shutdown instruction the earliestreceived the shutdown instruction and the exit time of the object thatis preset to receive the shutdown instruction the last received shutdowninstruction.

Prior to determining time at which a shutdown instruction is initiatedduring the system shutdown, the method may involve searching, for eachobject in the system, a corresponding time, or timestamp, at which therespective object received the shutdown instruction and an exit time ofthe respective object during the system shutdown.

As a second embodiment of the present disclosure, a terminal, mayinclude a first acquisition unit, a second acquisition unit, and acalculation unit. The first acquisition unit may determine a time atwhich a shutdown instruction is initiated during the system shutdown.The second acquisition unit may determine an exit time of an object thatis the last to exit during the system shutdown. The calculation unit maydetermine the time spent on the system shutdown based on the time atwhich the shutdown instruction is initiated and the exit time of theobject that is the last to exit.

The first acquisition unit may determine the time at which the shutdowninstruction is initiated by identifying an occurring time of a systemevent with the earliest occurring time from a system log. The system logmay be recorded during the system shutdown. The second acquisition unitmay determine an occurring time of a system event with the latestoccurring time from the system log. The calculation unit may determinethe time spent on the system shutdown based on the occurring time of thesystem event with the earliest occurring and the occurring time of thesystem event with the latest occurring time.

The first acquisition unit may, alternatively, or in addition, determinea time at which an object that is the first to receive the shutdowninstruction receives the shutdown instruction during the systemshutdown. The second acquisition unit may, alternatively, or inaddition, determine an exit time of an object that is the last toreceive the shutdown instruction during the system shutdown. In such acase, the calculation unit may determine the time spent on the systemshutdown based on the time at which the object that is the first toreceive the shutdown instruction receives the shutdown instruction, andthe exit time of the object that is the last to receive the shutdowninstruction.

In yet another example, the first acquisition unit may identify a firstobject that may be preset to receive the shutdown instruction theearliest in each system shutdown. The first acquisition unit may furtherdetermine the time at which the first preset object receives theshutdown instruction. The second acquisition unit may identify a secondobject that may be preset to receive the shutdown instruction the lastin each system shutdown. The second acquisition unit may furtherdetermine an exit time of the second object. Subsequently, thecalculation unit may determine the time spent on the system shutdownbased on the time at which the first object receives the shutdowninstruction, and the exit time of the second object.

The terminal further may further include a searching unit. The searchingunit may search records for each object in the system. The search may beperformed on a system log that may be recorded during the previoussystem shutdown. The searching unit may determine, based on the search,a time at which an object received the shutdown instruction and an exittime of the object during the system shutdown.

A third embodiment of the present disclosure may involve non-transitorystorage medium(s) in which executable instructions are contained. Theexecutable instructions, when executed by circuitry, such as one or moreprocessors may determine the time spent on system shutdown. The storagemedium may contain instructions, which when executed, result in at leastthe following operations. For example, a shutdown instruction may beinitiated during the system shutdown. An exit time of an object that isthe last to exit during the system shutdown may be recorded andidentified. Further, the time spent on the system shutdown may becalculated according to the time at which the shutdown instruction isinitiated and the exit time of the object that is the last to exit.

In the embodiments of the present disclosure, the time at which theshutdown instruction is initiated during the system shutdown may bedetermined. The exit time of the object that is the last to exit duringthe system shutdown may be determined. The time spent on the systemshutdown may be subsequently determined according to the time at whichthe shutdown instruction is initiated and the exit time of the objectthat is the last to exit. Thereby, not only can the time spent on systemshutdown be determined in case of a system rebooting process, but alsoduring other types of, or cases of system shutdown. The method fordetermining the time spent on system shutdown provided according to theembodiments of the present disclosure can determine the time spent onthe system shutdown each time the system is booted up, or is startedregardless of the reason the system was shut down previously. The usermay be instructed to optimize the system according to the time spent onsystem shutdown.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a flowchart of an example method to determine duration of asystem shutdown;

FIG. 2 shows a flowchart of an example method to determine duration of asystem shutdown;

FIG. 3 shows an example use case of an embodiment of the presentdisclosure;

FIG. 4 shows an example use case of an embodiment of the presentdisclosure;

FIG. 5 shows an example terminal according to an embodiment of thepresent disclosure; and

FIG. 6 shows an example terminal according to an embodiment of thepresent disclosure.

DETAILED DESCRIPTION

A method for determining time spent on system shutdown is describedfurther. The method enables determining duration of the previous systemshutdown when the system is restarted. The previous system shutdown timemay be determined regardless of the reason that the system was shut downbefore. Knowing the shutdown time may allow the user to optimize thesystem. Further, an apparatus to determine shutdown duration of a systemis also described.

The technical solutions according to the embodiments of the presentdisclosure are described in conjunction with the accompany drawings. Thedescribed embodiments are only some of the various possible embodimentsof the technical solutions provided by the present disclosure. Any otherembodiment obtained by those skilled in the art based on the embodimentsherein without inventive efforts falls within the scope of the presentdisclosure.

Referring to FIG. 1, an example method for determining time spent onsystem shutdown may include steps 101 to 103.

101 may involve identifying a time at which a shutdown instruction wasinitiated during the system shutdown.

102 may involve identifying an exit time of an object that is the lastobject to exit during the system shutdown.

103 may further involve determining the time spent on the systemshutdown based on the time at which the shutdown instruction isinitiated and the exit time of the object that is the last to exit.

The method for determining the time spent on system shutdown providedmay be used to determine the time spent on the previous system shutdowneach time the system is started. Thus, the shutdown duration may bedetermined regardless of the reason that the system was shut downbefore. The determined system shutdown time may be displayed to so theuser who may be subsequently instructed to optimize the system based onthe time spent on the system shutdown.

Referring to FIG. 2, another example of the method for determining thetime spent on system shutdown may include at least the steps 201 to 203.

201 may involve a terminal, during startup, identifying a time at whicha shutdown instruction was initiated during a previous system shutdown.The shutdown initiation time may be recorded by the system during thelast system shutdown. The time may be recorded as a timestamp in a logfile at a predetermined location. Alternatively, the time may berecorded as part of the system record, such as in the system registry.

Each time a user starts the terminal, the terminal may identify the timeat which the shutdown instruction was initiated during the last systemshutdown by searching the system record. The terminal may have been shutdown by powering off, rebooting or a as part of a normal shutdownprocedure. Regardless of why and/or how the last system shutdown wasperformed, the terminal may be able to determine the shutdown initiationtime.

202 may involve the terminal identifying an exit time of an object thatwas the last to exit. The exit time of the last object may be recordedby the system during the last system shutdown.

An ‘object’ may be a program, or a software application, a module of asoftware application, or a background process or service executing onthe system. Thus, in an example, the object that was the last to exitduring the last system shutdown may be a program that was the last toexit during the last shutdown. The exit time of the object that was thelast to exit may be understood, and/or used as the shutdown time of theterminal.

203 may involve the terminal determining the time spent on the lastsystem shutdown based on the time at which the shutdown instruction wasinitiated and the exit time of the object that was the last to exit.

The time at which the shutdown instruction was initiated may beunderstood, and/or used as the earliest time at which the shutdownoperation was initiated. The exit time of the object that was the lastto exit may be understood, and/or used as the time at which the terminalwas shut down or powered off. Therefore, the time spent on the lastsystem shutdown may be determined, for example, by subtracting the timerecorded by the system at which the shutdown instruction was initiatedfrom the exit time of the object that was the last to exit.

Thus, determining the duration of the previous system shutdown, when thesystem is rebooting, booting, or starting up may include at least thefollowing steps. The time at which the shutdown instruction wasinitiated for the last system shutdown may be identified. The shutdowninitiation time may be recorded by the system during previous shutdown.Further, the object that was the last to exit during the last systemshutdown may be identified. The time the last object exited may berecorded by the system during the shutdown. The exit time of the lastobject may be further identified. The time spent on the last systemshutdown may be determined based on the time at which the shutdowninstruction was initiated and the exit time of the object that was thelast to exit. The method may be used to determine the time spent on thelast system shutdown each time the system is started, regardless of thereason that the system was shut down before. The user may be instructedto optimize the system according to the time spent on system shutdown.Hence, the provided method may be advantageous over determining the timespent on system shutdown only during a system rebooting process.

In an example of determining the time spent on system shutdownidentifying a time at which a shutdown instruction was initiated duringthe last system shutdown may include identifying the time of occurrenceof a system event that was the earliest event recorded during theprevious system shutdown. The earliest system event may be identified asthe event that has the earliest occurrence time in a system log. Thesystem log may be recorded by the system during the last systemshutdown.

Determining the exit time of the object that was the last to exit duringthe last system shutdown may include identifying the time of occurrenceof a system event that has the latest event recorded by the systemduring the last system shutdown. The latest system event may beidentified as the event that has the latest occurrence time in thesystem log.

Determining, or obtaining the time spent on the last system shutdownaccording to the time at which the shutdown instruction was initiatedand the exit time of the object that was the last to exit may includeusing the respective recorded occurrence times of the earliest occurringevent and the latest occurring event according to the system log.

As an example, assume the system uses a Windows-based operating system(Windows), such as Windows 7, Windows 8 or any other version developedor based upon the operating system developed by Microsoft Corporation.The occurrence time of an event in the system may be recorded in asystem log of Windows. The system log may be stored on a system disc.For example, in the case of Windows 7, the storage path of the systemlog may be “system disk:\Windows\System32\winevt\Logs\System.evtx” andin the case of Windows XP, the storage path of the system log may be“system installation disk:\Windows\System32\config\SysEvent.evt”. Bysearching for event occurring times in the system log, the occurrencetime of the system event that has the earliest occurring time may beidentified. Similarly, the occurrence time of the system event that hasthe latest occurring time as recorded by the system during the lastsystem shutdown may be acquired. The time spent on the last systemshutdown may be determined by subtracting the occurrence time of thesystem event that has the earliest occurring time from the occurrencetime of the system event that has the latest occurring time.

For example, as in an example use case illustrated by FIG. 3, the systemlog recorded during the last shutdown may be searched and the earliestand latest system events in the system log may be identified. Forexample, by searching the system log that was recorded during the lastsystem shutdown, the earliest system event may be identified as thesystem event corresponding to event ID 1074 and with occurring time20:46:21. Further, by searching the system log that was recorded duringthe last system shutdown, the system event that has the latest occurringtime may be found as the system event with event ID 13 and occurringtime 20:46:47. In this case, 26 seconds elapsed from the two occurrencetimes, 20:46:21 to 20:46:47. Thus, the time spent on the last systemshutdown may be determined to be 26 seconds.

The time spent on the last system shutdown may be calculated duringsystem booting. The determined time spent on the last system shutdownmay be displayed after the booting. For example, the shutdown durationmay be displayed on the system display so as to instruct the user tooptimize the system in view of the time spent on the last systemshutdown. Specific optimization schemes may be generated.

The Windows operating system is used as merely an example. The systemmay also be a Unix system, a Linux system, a MAC system, an Androidsystem, or a system using any other operating system. Further examplesare omitted here. However, the time spent on the last system shutdownmay be acquired according to the technical solution provided by theembodiments of the present disclosure no matter what the operatingsystem is.

Thus, an example method for determining a time spent on system shutdownmay include at least the following steps.

A shutdown instruction time may be identified which may correspond to ashutdown being initiated. The shutdown instruction time may beidentified based on a system log recorded by the system during the lastsystem shutdown. The shutdown instruction time identification mayfurther involve identifying an earliest object during the last shutdown.The earliest object may be the object that was the first to receive theshutdown instruction. The time at which the earliest object received theshutdown instruction may be recorded by the system during the lastsystem shutdown. The time at which the shutdown instruction was receivedby the earliest object may be considered the shutdown instruction time.

Further, an exit time may be identified as the time at which the lastobject was shutdown during the last shutdown. The last object may beidentified as the object that was the last to exit as recorded by thesystem during the last system shutdown. Identifying the exit time mayinvolve identifying the last object and further identifying the exittime of the last object. The last object may be identified from thesystem records as the system event that was the last to receive theshutdown instruction.

Further yet, the time spent on the last system shutdown may bedetermined using the time at which the shutdown instruction wasinitiated and the exit time of the object that was the last to exit may.Thus, the last system shutdown duration may be determined according tothe time at which the object that was the first to receive the shutdowninstruction receives the shutdown instruction and the exit time of theobject that was the last to receive the shutdown instruction.

In an example system, assume 50 programs are to be notified to exit forthe system to shut down. The time at which each program receives theshutdown instruction and the exit time of each program will be recordedby the system. Then, by searching the system record and comparing thetimes, the exit time of the object that was the last to receive theshutdown instruction (exit time) and the time at which the object thatwas the first to receive the shutdown instruction (first shutdowninstruction time) may be found. The time spent on the last systemshutdown may be determined by subtracting the first shutdown time fromthe exit time.

Thus, another method for determining the time spent on system mayinclude at least the following steps.

A time at which a shutdown instruction was initiated during the lastsystem shutdown may be identified. The time may be recorded by thesystem. Identifying such a time may include identifying an object thatis preset to receive the shutdown instruction the earliest. Thus, thetime recorded by the system at which the preset object received theshutdown instruction may be identified as the time at which the lastshutdown instruction was initated.

An exit time of an object that was the last to exit during the lastsystem shutdown may be identified. The exit time may be recorded by thesystem. Identifying such an exit time may include identifying an objectthat is preset to acquire the shutdown instruction the last in eachsystem shutdown. Thus, the time recorded by the system at which thepreset object exited (or shutdown) may be identified as the exit time.

The time spent on the last system shutdown may be determined using thetime at which the shutdown instruction is initiated and the exit time ofthe object that was the last to exit. Determining the time spent on thelast system shutdown may further include calculating the time spent onthe last system shutdown according to the time at which the object thatacquires the shutdown instruction the earliest receives the shutdowninstruction and the exit time of the object that obtains the shutdowninstruction the last.

For example, among several programs in the system, two programs may bepreset or predetermined to receive the shutdown instruction the firstand at the last respectively. One of the programs may be a program thatis preset as the first to receive the shutdown instruction in responseto the shutdown instruction being initiated. The other, second, programmay be a program that receives, and/or is preset to receive, theshutdown instruction the last during the shutdown. Thus, the time spenton the last system shutdown may be calculated from the times at whichthe two predetermined programs received the shutdown instruction and theexit times of the two predetermined programs. This may eliminatecomparing the times at which all programs in the system received theshutdown instruction and the exit times of all the programs.

Thus, yet another example method for calculating time spent on systemshutdown may include at least the following steps.

The method may involve identifying a time at which a shutdowninstruction was initiated during the last system shutdown, and asrecorded by the system. Identifying such time may further include searchoperations across each object in the system. For example, the searchoperation may search for a time at which the object received theshutdown instruction and an exit time of the object during the lastsystem shutdown, as were recorded by the system. Thus, the searchoperations may involve identifying corresponding data in the systemrecords.

Thus, the time at which each object received the shutdown instructionand the exit time of each object may be found from the system record.And by comparing one by one, the time at which the shutdown instructionwas received the earliest and the exit time of the object that was thelast to exit, as recorded by the system during the last system shutdown,may be determined. Hence the time spent on the last system shutdown maybe determined.

For a better understanding, the process in the embodiments of thepresent disclosure for determining the time spent on system shutdown isdescribed using some exemplary application scenarios.

For example, after using the system, the user may shut down the systemof a terminal normally, such as by using a system shutdown command asprovided by the system. The system programs on the terminal may benotified to exit one after another. The time at which each systemprogram is notified to exit and the actual exit time of each systemprogram may be recorded by the system. For a system program that has asubstantially short interval between the time when it is notified andits exit time, it may be understood that the system program exitsimmediately after it receives the notification. The time at which thesystem program, in such a case, is notified to exit and the actual exittime of the system program may be deemed as the same time.

At a later time, after the shutdown, the user may want to use theterminal again and may start the terminal. The terminal, during bootup,may access the system event data recorded during the last shutdown. Theterminal may compare the time recorded by the system at which eachsystem program was notified to exit. Based on such information, thesystem may identify a system program that was notified of the shutdownthe earliest. The time at which the earliest system program received thenotification may be determined as the time at which the shutdowninstruction was initiated. The terminal may further search for a systemprogram that exited the latest. The terminal may access actual exittimes of each system program as recorded by the terminal during the lastshutdown. The terminal may compare the exit times of the system programsto identify the system program that exited the latest. The exit time ofthe identified system program may be determined as the shutdown time. Inthis way, the time spent on the last system shutdown may be acquiredfrom the time difference between the shutdown time and the time at whichthe shutdown instruction was initiated.

When the terminal has been fully started up, the time spent on the lastsystem shutdown may be prompted, or displayed, such as in a window. Theuser may evaluate whether the system needs to be optimized in view ofthe displayed time spent on the last system shutdown.

When the terminal receives a logout or rebooting instruction, systemprograms on the terminal may be notified to exit one after another. Thetime at which each system program is notified to exit and the actualexit time of each system program may be recorded by the system. For asystem program that has a substantially short interval between the timewhen it is notified and its exit time, it may be understood that thesystem program exits immediately after it receives the notification. Incase of such system programs, the time at which the system program isnotified to exit and the actual exit time of the system program may bedeemed to be the same.

Once booting starts, the terminal may compare the times recorded by thesystem at which each system program was notified to exit. Based on thecomparison a system program that was notified to exit the earliest maybe identified. The time at which the identified earliest system program,that was notified to exit the earliest, received the notification may bedetermined as the time at which the shutdown instruction was initiated.Further, the terminal may search for a system program that exited thelatest by comparing the actual exit times of each system program. Theexit time of the system program that exited the last is determined asthe shutdown time. The time spent on the last system shutdown may bedetermined from the time difference between the shutdown time and thetime at which the shutdown instruction was initiated.

When the terminal has been fully started up, the time spent on the lastsystem shutdown may be prompted or displayed for a user, such as via awindow. The user may evaluate whether the system needs to be optimizedaccording to the time spent on the last system shutdown.

In another example case, the terminal may be shut down due to a suddenpower off or in some other abnormal cases. The terminal, in such cases,may or may not determine the time spent on the last system shutdown.This is because, system programs on the terminal may stop abruptly incase the power was suddenly off. In this case, the obtained time spenton system shutdown may not be significant to be used for optimization.

Referring to FIG. 5, an example terminal may include circuitry such as afirst acquisition unit 301, a second acquisition unit 302, and acalculation unit 303.

The first acquisition unit 301 may identify a time at which a shutdowninstruction is initiated during a system shutdown to shut down theterminal.

The second acquisition unit 302 may identify an exit time of an objectthat is the last to exit during the system shutdown.

The calculation unit 303 may determine the time spent on the systemshutdown based on the time at which the shutdown instruction isinitiated as identified by the first acquisition unit 301, and the exittime of the object that is the last to exit as identified by the secondacquisition unit 302.

Thus, the first acquisition unit 301 may identify the time at which theshutdown instruction is initiated during the system shutdown. The secondacquisition unit 302 may identify the exit time of the object that isthe last to exit during the system shutdown. The calculation unit 303may determine the time spent on the system shutdown according to thetime at which the shutdown instruction is initiated and the exit time ofthe object that is the last to exit. The method and/or terminal fordetermining time spent on the last system shutdown may determine thesystem time spent on the last system shutdown each time the system isbooting, regardless of the reason that the system was shut down before.For example, the system may have been rebooted to cause the previousshutdown, or the system may have been shutdown using a system shutdowncommand. In another example, the system may have shutdown due to a powerfailure, or some other error. The user may be instructed to optimize thesystem according to the time spent on system shutdown.

Thus, an example system to determine the time spend on a last systemshutdown may include at least the following hardware components.

The first acquisition unit 301 that may determine the occurring time ofa system event that has the earliest occurring time in a system logduring the system shutdown. The system log may be a record of systemevents that may have occurred during the last system shutdown. Thesystem log may contain an event identifier, a corresponding time atwhich the event occurred, and an object identifier. The event identifiermay be a unique identifier representing the event record. The objectidentifier may indicate an object on which, or pertaining to which, theevent occurred. For example, a system event may be recorded when anobject, such as an executing program in the system receives anotification to exit, in response to the system shutdown. In addition,the system log may contain other information related to the event, suchas a cause of the event, and an entity that may have initiated theevent.

The second acquisition unit 302 may identify the occurring time of asystem event that has the latest occurring time from the system log thatwas recorded during the system shutdown.

The calculation unit 303 may compute the time spent on the systemshutdown according to, the occurring time of the system event that hasthe earliest occurring time and the occurring time of the system eventthat has the latest occurring time. The occurring times used during thecomputation may be those recorded in the system log.

In another example, referring to FIG. 5, the circuitry of an examplesystem may include hardware as described below.

The first acquisition unit 301 may identify a first object that is thefirst to receive the shutdown instruction. The time at which theidentified first object received the shutdown instruction during thesystem shutdown, may be considered a shutdown initiation time.

The second acquisition unit 302 may identify a second object that is thelast to receive the shutdown instruction during the system shutdown. Theexit time of the identified second object may be considered a shutdowncompletion time.

The calculation unit 303 may determine the time spent on system shutdownaccording to the shutdown initiation time and the shutdown completiontime.

In yet another example, referring to FIG. 5, the system to determine aduration of the previous system shutdown may include hardware asdescribed further.

The first acquisition unit 301 may identify the time at which a firstpredetermined object receives the shutdown instruction. The firstpredetermined object may be preset to receive the shutdown instructionthe earliest in each system shutdown.

The second acquisition unit 302 may identify the exit time of a secondpredetermined object. The second predetermined object may be preset toobtain the shutdown instruction the last in each system shutdown.

The calculation unit 303 may determine the duration of the previoussystem shutdown based on the time at which the first predeterminedobject receives the shutdown instruction, and the exit time of thesecond predetermined object.

In yet another example, with reference to FIG. 6, the system todetermine the time spent on the previous system shutdown may include, inaddition to the components described throughout the present disclosure,at least a searching unit 304.

The searching unit 304 may search system records. The searching unit 304may access system logs during the last system shutdown to identifyinformation to be used to determine the time spent during the shutdown.For example, the searching unit 304 may identify objects in the systemlog. Further, for each object in the system, the searching unit 304 maysearch for a time at which the object received the shutdown instructionduring the previous shut down. Further yet, the searching unit 304 mayalso search for and identify an exit time of the object during thesystem shutdown.

It should be understood by those skilled in the art that all or some ofthe steps in the methods according to the above embodiments may beimplemented by hardware. Further the objects may be stored on a computerreadable storage medium such as ROM, RAM, a magnetic disc or an opticaldisk. Further, the embodiments described throughout the presentdisclosure may involve hardware that may be controlled by computerexecutable instructions.

Technical features in methods and systems for determining the time spenton system shutdown are described in detail above. Specific examples areprovided to describe the principles and technical features. Thedescription of the embodiments is only used to help understand thetechnical features and is not to be considered limiting. Moreover,modifications may be made to the embodiments of the present disclosureby those skilled in the art based on the technical features described inthe present disclosure. Therefore, the specification shall not beinterpreted as limiting the scope of the present disclosure.

The invention claimed is:
 1. A computer implemented method fordetermining time spent on system shutdown, comprising: presetting afirst program to receive a shutdown instruction the earliest during thesystem shutdown, a second program to receive the shutdown instructionthe last during the system shutdown; determining a time at which thefirst program receives the shutdown instruction; determining an exittime of the second program; and determining the time spent on the systemshutdown based on the time at which the first program receives theshutdown instruction and the exit time of the second program.
 2. Themethod according to claim 1, further comprising: searching, for eachobject in the system, for a time at which the object receives theshutdown instruction and an exit time of the object, wherein the searchis conducted in a system log recorded during the system shutdown.
 3. Aterminal, comprising: a processor and a memory havingprocessor-executable instructions stored therein, and the instructionswhen executed by the processor, configure the processor to: preset afirst program to receive a shutdown instruction the earliest during asystem shutdown, a second program to receive the shutdown instructionthe last during the system shutdown; determine a time at which the firstprogram receives the shutdown instruction; determine an exit time of thesecond program; and determine the time spent on the system shutdownbased on the time at which the first program receives the shutdowninstruction and the exit time of the second program.
 4. The terminalaccording to claim 3, wherein the processor is configured to: asearching unit, configured to identify, for an object in the terminal, atime at which the object receives the shutdown instruction and an exittime of the object during the system shutdown.
 5. A non-transitorystorage medium comprising computer executable instructions, wherein theexecutable instructions are configured to implement a method fordetermining time spent on system shutdown, and the method comprises:presetting a first program to receive a shutdown instruction theearliest during a system shutdown, a second program to receive theshutdown instruction the last during the system shutdown; determining atime at which the first program receives the shutdown instruction;determining an exit time of the second program; and determining the timespent on the system shutdown based on the time at which the firstprogram receives the shutdown instruction and the exit time of thesecond program.